import ActorTypeUtil from "@/ActorTypeUtil";
import DamageUtil from "@/DamageUtil";
import TextTagUtil from "@/TextTagUtil";

export default class 荣誉护盾 {


    constructor() {

        /**
         * 增加20%反弹，50点护甲。
         * 增加30%反弹，100点护甲。
         * 增加40%反弹，150点护甲。
         */
        let actorType = ActorTypeUtil.getActorType("荣誉护盾(一级)");
        /**当关联的单位 受到伤害的时候*/
        actorType.onUnitDamaged = (actor, damageSource, event) => {
            DamageUtil.damage(actor.unit, damageSource, event.resultDamage * 0.2);
            TextTagUtil.textSuccess("反弹:" + (event.resultDamage * 0.2), damageSource);

        }
        //
        actorType = ActorTypeUtil.getActorType("荣誉护盾(二级)");
        /**当关联的单位 受到伤害的时候*/
        actorType.onUnitDamaged = (actor, damageSource, event) => {
            DamageUtil.damage(actor.unit, damageSource, event.resultDamage * 0.3);

        }
        //
        actorType = ActorTypeUtil.getActorType("荣誉护盾(三级)");
        /**当关联的单位 受到伤害的时候*/
        actorType.onUnitDamaged = (actor, damageSource, event) => {
            DamageUtil.damage(actor.unit, damageSource, event.resultDamage * 0.4);

        }


    }


}